﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CreatingObject;
using System.Data.SqlClient;

namespace NWTwin
{
    class NWTwin
    {
        static void Main(string[] args)
        {
            NorthwindEntities nWEntity = new NorthwindEntities();
            //nWEntity.ExecuteStoreCommand("Create database NorthWindTwin");
            string script = nWEntity.CreateDatabaseScript();
            string connectionStr = "server = .\\SQLEXPRESS; database=NorthWindTwin; Integrated security = true";

            SqlConnection dbCon = new SqlConnection(connectionStr);
            dbCon.Open();
            using (dbCon)
            {
                SqlCommand scriptCom = new SqlCommand(script, dbCon);
                scriptCom.ExecuteNonQuery();
            }
        }
    }
}
